<script>
	import ws from '@/static/api/ws.js'
	import {mapGetters} from 'vuex'
	export default {
		// mixins:[shareMixins,getShare],
		data() {
			return {
			};
		},
		computed:{
			//login_status 0 未登录 、1临时微信登录 2已登录
			...mapGetters([
				'login_status',
				'configObj',
				'userInfo',
			])
		},
		watch:{
			login_status(val){
				if(val==2){
					this.wsFun()
				}
			}
		},
		onLaunch: function(option) {
			console.log('App onLaunch')
			
		},
		onShow: function(option) {
			console.log('App onShow')
			if(this.login_status>=1){
				this.wsFun()
			}
		},
		onHide: function() {
			console.log('App Hide')
			// 关闭后 清楚缓存地址
			// 关闭SOKET
			ws.completeClose()
		},
		methods: {
			wsFun(){
				console.log('准备走soket')
					if(this.login_status>=1){
						ws.init(this)
					}else{
						ws.completeClose()
					}
			},
		}
	}
</script>

<style lang="less">
	/*每个页面公共css */
	@import url("./components/iconFont/iconfont.css"); 
	@import url("./static/css/styl.less");
</style>
